def read_file(file_path, encoding='utf-8'):
    try:
        with open(file_path, 'r', encoding=encoding) as f:
            content = f.read()
            print(f"成功读取文件: {file_path}")
            return content
    except Exception as e:
        print(f"读取文件失败: {file_path}, 错误信息: {e}")
        raise

def save_to_file(file_path, content, encoding='utf-8'):
    try:
        with open(file_path, "w", encoding=encoding) as f:
            f.write(content)
        print(f"成功保存文件: {file_path}")
    except Exception as e:
        print(f"保存文件失败: {file_path}, 错误信息: {e}")
        raise